package com.jcl.recruit.log.dao;

import com.jcl.core.db.DatabaseContext;
import com.jcl.recruit.log.mapper.ResumeLogMapper;
import com.jcl.recruit.log.model.ResumeLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class ResumeLogDao implements ResumeLogMapper {

    @Autowired
    private ResumeLogMapper resumeLogMapper;


    @Override
    public List<ResumeLog> findList(Integer resumeId) {
        DatabaseContext.setCurrentContext();
        return resumeLogMapper.findList(resumeId);
    }

    @Override
    public List<ResumeLog> findListByCorp(String corpCode,
                                          Integer userId,
                                          Integer category) {
        DatabaseContext.setCurrentContext();
        return resumeLogMapper.findListByCorp(corpCode, userId, category);
    }

    @Override
    public List<ResumeLog> findListByCorpAndResume(String corpCode,
                                                   Integer userId,
                                                   Integer resumeId,
                                                   Integer category) {
        DatabaseContext.setCurrentContext();
        return resumeLogMapper.findListByCorpAndResume(corpCode, userId, resumeId, category);
    }

    @Override
    public int insert(ResumeLog record) {
        DatabaseContext.setCurrentContext();
        return resumeLogMapper.insert(record);
    }

}
